/* 全局样式 */
:root {
    --primary-color: #4e73df;
    --secondary-color: #f8f9fc;
    --accent-color: #2e59d9;
    --text-color: #5a5c69;
    --light-text: #858796;
    --border-color: #e3e6f0;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --dark-color: #212121;
    --light-color: #f5f5f5;
    --border-radius: 8px;
}

body {
    font-family: 'Nunito', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* 导航栏样式 */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-color) !important;
}

.nav-link {
    font-weight: 600;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
}

/* 主页卡片样式 */
.main-card {
    border: none;
    border-radius: 0.8rem;
    box-shadow: 0 0.15rem 1.75rem rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.main-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.1);
}

.card-header {
    border-bottom: 1px solid var(--border-color);
}

.about-card .card-header {
    font-weight: 600;
}

/* 上传区域样式 */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 1rem;
    padding: 2.5rem;
    text-align: center;
    position: relative;
    transition: all 0.3s;
    background-color: rgba(78, 115, 223, 0.03);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(78, 115, 223, 0.05);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.upload-text {
    font-weight: 600;
    margin-bottom: 1rem;
}

.file-input {
    display: none;
}

.file-label {
    cursor: pointer;
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 500;
}

/* 处理状态区域 */
.processing-status {
    display: none;
    text-align: center;
    margin: 2rem 0;
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 0.25rem solid rgba(78, 115, 223, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spinner 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* 结果区域 */
.results-area {
    margin-top: 2rem;
    display: none;
}

.result-card {
    margin-bottom: 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.result-card-header {
    background-color: rgba(78, 115, 223, 0.05);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-card-body {
    padding: 1.5rem;
}

.chart-container {
    height: 300px;
    margin-bottom: 1.5rem;
    position: relative;
}

.results-table {
    width: 100%;
}

.results-table th {
    background-color: rgba(78, 115, 223, 0.05);
    font-weight: 600;
    border-top: none;
}

/* 情绪标签样式 */
.emotion-badge {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 50rem;
}

.emotion-badge.happy {
    background-color: rgba(28, 200, 138, 0.2);
    color: var(--success-color);
}

.emotion-badge.sad {
    background-color: rgba(78, 115, 223, 0.2);
    color: var(--primary-color);
}

.emotion-badge.angry {
    background-color: rgba(231, 74, 59, 0.2);
    color: var(--danger-color);
}

.emotion-badge.surprise {
    background-color: rgba(246, 194, 62, 0.2);
    color: var(--warning-color);
}

.emotion-badge.fear {
    background-color: rgba(54, 185, 204, 0.2);
    color: var(--info-color);
}

.emotion-badge.disgust {
    background-color: rgba(133, 135, 150, 0.2);
    color: var(--light-text);
}

.emotion-badge.neutral {
    background-color: rgba(244, 246, 249, 0.7);
    color: var(--text-color);
}

/* 特性列表 */
.feature-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.feature-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.feature-list li:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 0.5rem;
    height: 0.5rem;
    background-color: var(--primary-color);
    border-radius: 50%;
}

/* 技术栈图标 */
.tech-icon {
    max-width: 48px;
    height: auto;
}

/* 情绪时间线 */
.emotion-timeline {
    position: relative;
    height: 30px;
    background-color: #f5f7fa;
    border-radius: 4px;
    margin: 15px 0;
}

.timeline-marker {
    position: absolute;
    top: 0;
    width: 10px;
    height: 30px;
    background-color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.timeline-marker:hover, .timeline-marker.active {
    opacity: 1;
    height: 35px;
    top: -3px;
    transform: scale(1.2);
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.timeline-emotions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

#current-emotion-label {
    display: inline-block;
    min-width: 80px;
    text-align: center;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.realtime-emotion-description {
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
    padding: 10px;
}

/* 分析设置区域 */
.analysis-settings {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e3e6f0;
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #5a5c69;
    margin-bottom: 0.5rem;
}

.form-range {
    height: 1.5rem;
    transition: all 0.2s;
}

.form-range::-webkit-slider-thumb {
    background-color: var(--primary-color);
}

.form-range::-moz-range-thumb {
    background-color: var(--primary-color);
}

.form-range:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.3);
}

.form-range:focus::-moz-range-thumb {
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.3);
}

/* 页脚样式 */
.footer {
    background-color: #fff;
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
}

/* 应用卡片和团队卡片 */
.application-card, .team-card {
    height: 100%;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 0.15rem 1.75rem rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    overflow: hidden;
}

.application-card:hover, .team-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.1);
}

.app-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* 按钮样式 */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0.125rem 0.25rem rgba(78, 115, 223, 0.1);
}

.btn-primary:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 暗黑模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #121212;
        color: #e0e0e0;
    }
    
    .navbar, .footer {
        background-color: #1e1e1e !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }
    
    .navbar-light .navbar-brand,
    .navbar-light .navbar-nav .nav-link {
        color: #e0e0e0 !important;
    }
    
    .navbar-light .navbar-toggler-icon {
        filter: invert(1);
    }
    
    .card, .main-card {
        background-color: #1e1e1e;
        border-color: #333;
    }
    
    .form-control {
        background-color: #333;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .text-muted {
        color: #aaa !important;
    }
    
    .upload-area {
        border-color: #444;
        background-color: rgba(255, 255, 255, 0.03);
    }
    
    .upload-area:hover {
        border-color: var(--primary-color);
        background-color: rgba(78, 115, 223, 0.08);
    }
    
    .table {
        color: #e0e0e0;
    }
    
    .table thead th {
        background-color: #252525;
        border-color: #333;
    }
    
    .table td {
        border-color: #333;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c1c3d1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a3a4af;
}

/* 微表情识别结果卡片 */
.expression-result-card {
    border-left: 4px solid var(--primary-color);
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.expression-result-card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.expression-timestamp {
    font-size: 0.85rem;
    color: var(--light-text);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .upload-area {
        padding: 1.5rem;
    }
    
    .chart-container {
        height: 250px;
    }
}

/* 添加一些过渡效果 */
.fade-in-emotion {
    animation: fadeInEmotion 0.3s ease-in-out;
}

@keyframes fadeInEmotion {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}